package com.muchfish.reactor.api;

import reactor.core.publisher.Flux;

public class ReactorScanExample {
    public static void main(String[] args) {
        Flux<Integer> source = Flux.just(1, 2, 3, 4, 5);

        // 对数据流中的元素进行累积操作
        source.scan(0, (acc, value) -> acc + value)
                .subscribe(System.out::println);
    }
}
